// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
import { routes } from './router-config'
import Vuex from 'vuex'
import VueResource from 'vue-resource'
import * as filters from './filter'
import store from './vuex/store'
//注册过滤器
Object.keys(filters).forEach((K)=>{
  Vue.filter(K,filters[K])
})

Vue.use(VueRouter)
Vue.use(Vuex)
Vue.use(VueResource)
// Vue.use(VueAnimatedList)
/* eslint-disable no-new */

const router = new VueRouter({
  routes,
  mode:'history',
})
router.beforeEach((to,from,next)=>{
  console.log("to,",to);
  console.log("from,",from);
  next();
})

// new Vue({
//   el: '#app',
//   render: h => h(App),
//   //挂在到根实例上
  
// })
new Vue({
  el:'#app',
  render: h => h(App),
  router,
  store
})
